package com.hakim.wfb.common.enums;

/**
 * 成功、失败枚举
 * Created by walkman on 2017/7/9.
 */
public enum SuccessFailEnum {

    SUCCESS(1, "成功"),
    FAIL(2, "失败");

    private int value;
    private String description;

    private SuccessFailEnum(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    public static SuccessFailEnum getByValue(int value) {
        SuccessFailEnum[] codes = values();
        for (SuccessFailEnum each : codes) {
            if (each.value == value) {
                return each;
            }
        }
        return null;
    }
}
